FROM nginx:latest

RUN mkdir /app
RUN mkdir -p /etc/nginx/logs
COPY ./dist /app
COPY ./nginx/nginx.conf /nginx.conf.template

ENV BACKEND_URL=""

CMD envsubst '$BACKEND_URL' < /nginx.conf.template > /etc/nginx/nginx.conf \
	&& cat /etc/nginx/nginx.conf \
	&& nginx -g 'daemon off;'
